package org.mdrtwell.jdk15;

public class TestVarargs {
	private static int sum(int... nums) {// �ɱ��������Ƿ�����������һ������
		int sum = 0;
		for (int i : nums) {
			sum += i;
		}
		return sum;
	}

	public static void main(String[] args) {
		System.out.println(sum(1, 2));
		System.out.println(sum(1, 2, 3));
		System.out.println(sum(1, 2, 3, 4));
	}
}
